
export default function trackable(construct) {
  if (typeof construct !== 'function') throw 'trackable only accept a function';
  construct.childClass = []
  function TempFN () {}
  return new Proxy(construct, {
    construct: function(construct, args, real) {
      construct.childClass.push(real);
      TempFN.prototype = real.prototype;
      return Object.assign(new TempFN(), new construct(args))
    }
  })
}


